<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="<c:url value="/root/css/estilo.css"/>" >
<script src="<c:url value="/root/js/funcoes.js"/>"></script>
<script src="<c:url value="/root/js/jquery.js"/>"></script>
<script type="text/javascript">
	$(document).ready(function(){
		<c:if test="${msg != null}">
			alert("${msg}");
		</c:if>
	});	
	function excluir(id){
		if(confirm("Deseja Excluir o aluno ")){
			location.href="excluir?id="+id;
		}
	}
</script>
</head>
<body>
	<input type="button"  value="Teste" onclick="lightBox()"/>
	<a href="novo">Cadastrar Novo Aluno</a>
	<h1>Lista de Alunos</h1>
	<ul>
		
			<c:forEach items="${lista}" var="aluno">
				<li>
					<font face="arial" size="2" >Nome: ${aluno.nome}</font>
					<font face="arial" size="2" color="#0099jj">Idade: ${aluno.idade}</font>
					<a href="editar?id=${aluno.id}" >Editar</a>
					<a href="#" onclick="excluir(${aluno.id})">Excluir</a>
				</li>	
			</c:forEach>
			<c:if test="${lista.size() < 1 }">
				<li>Nenhum Aluno Cadastrado!</li>
			</c:if>
	</ul>
</body>
</html>